function getDateStr() {
    const date = new Date();
    const dateStr = `${date.getFullYear()}/${date.getMonth()}/${date.getDay()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
    return dateStr;
}

function log(msg, ...params) {
    console.log(`${getDateStr()} ${msg}`, ...params);
}

function error(msg, ...params) {
    console.error(`${getDateStr()} ${msg}`, ...params);
}

const logger = {
    log,
    error
}

exports.logger = logger;